(function($, window) {
	/* 封装ajax */
	var ajax = function(url,type,data){
		var res = null;
		try{
			$.ajax({
				url: url,
				type: type,
				data : data?data:{},
				async: false,
				success: function(data) {
					res = data
				},
				error: function(xhr, type, errorThrown) {
					$.toast(type+"："+errorThrown)
				}
			});
			return res;
		}catch(e){
			$.toast("服务器请求失败！")
			return res;
		}
	}
	
	window.$api = {
		//重置密码
		resetPass : function(oldPass, newPass) {
			return ajax('login.html',"GET")
		}
	}
})(mui, window)
